import { RouteRecordRaw, createRouter, createWebHashHistory } from 'vue-router'

import Layout from '@/layout/Layout.vue'

const routes: RouteRecordRaw[] = [
    {
        path: '/',
        redirect: '/login'
    },
    // 登录
    {
        path: '/login',
        component: () => import('@/views/login/login.vue')
    },
    {
        path: '/home',
        component: () => Layout,
        meta: { title: '首页' },

    },
    // 护士模块
    {
        path: '/nurse',
        component: Layout,
        meta: { title: '分级护士' },
        children: [
            {
                path: 'info',
                component: () => import('@/views/triage_nurse/nurseInfo.vue'),
                meta: { title: '修改个人信息' }
            },
            {
                path: 'list',
                component: () => import('@/views/triage_nurse/nurseList.vue'),
                meta: { title: '综合列表' }
            },
            {
                path: 'relay',
                component: () => import('@/views/triage_nurse/relay.vue'),
                meta: { title: '排班管理' }
            }
        ]
    },
    // 医生模块
    {
        path: '/doctor',
        component: Layout,
        meta: { title: '分级医生' },
        children: [
            {
                path: 'info',
                component: () => import('@/views/doctor/doctorInfo.vue'),
                meta: { title: '修改个人信息' }
            },
            {
                path: 'list',
                component: () => import('@/views/doctor/doctorList.vue'),
                meta: { title: '综合列表' }
            },
            {
                path: 'relay',
                component: () => import('@/views/doctor/relay.vue'),
                meta: { title: '排班列表' }
            }
        ]
    }
]

export default createRouter({
    routes,
    history: createWebHashHistory()
})